/**
 * Created by chengming on 18/5/27.
 * version 1.0
 */
const BaseJsonAdapter = require('../base/BaseJsonAdapter');
const iconv = require("iconv-lite");
const vm = require('vm');

module.exports = class NeteasyMoney extends BaseJsonAdapter{
	async reqJson(){
		const body = await this.doRequest();
		let decodeBody = iconv.decode(body, this.encoding).toString();
		vm.runInThisContext(decodeBody);
		console.log(JSON.stringify(data));
		let list=[];
		for (var i = 0; i<data.news[1].length;i++) {
			let item={};
			let temp=data.news[1][i];
			item.t=temp.t;
			item.l=temp.l;
			list[i]=item;
		}
		return {"news":list};
	}
}
